#include <signal.h>
#include <sys/types.h>
#include <unistd.h>
#ifndef LRC_SHOW_H
#define LRC_SHOW_H
#define do_debug(...) debug_real (__func__, __FILE__, __LINE__, TRUE, __VA_ARGS__)
#define max_lrc_line 1024
/// 如果要超过1024，那太疯狂了。不支持它。

#define all_to_utf8_(a) all_to_utf8(a,-1)
#define lrc_tm 250
#define sig_reload_lrc 35

typedef struct {
 gchar *artist;
 gchar *title;
 gchar *lrc;
} Mata;

typedef struct __LRC__{
gint64 tm;
gint pt;
gint n;
} lrc_st;

typedef struct {
	GtkWidget *treeview;
	GtkWidget *data1;
	unsigned int id;
	char* artist;
	char* title;
}_THREAD_DATA;

typedef enum
{
 LRC_SET,
 LRC_RD,
 LRC_WD
}LRC_FILE_FLAG;

   GtkTextBuffer *buffer;
   GtkTextTag *tag;
   gchar* lyric_filename ; //保存
gboolean is_down_ok;
gboolean lrc_show ;
gboolean is_lrc_in_buff;

void load_lrc_file(gchar *file,gchar *arts,gchar *title);
GtkWidget *load_lrc_ui(gchar *ui);
gboolean lrc_insert_buffer(gchar *file/*,gchar *arts,gchar *title*/);
void clear_view(void);
gint show_diff_in_lrc(gint64 tm);
gchar *all_to_utf8(gchar *str,gsize max);

gchar *get_addr(gchar *str,char ch);
gboolean play_lrc(gpointer data);
gchar *encode_to_self(gchar *str);
void lrc_set_view(gchar *text);

GtkWidget *status_menu(GtkWindow *totem_win);
GtkStatusIcon  *status_icon(GtkWidget *menu,gchar *ico);


void sort_lines(void);
extern gint64 now ;
gboolean hand_win(gpointer data);
gpointer *get_store_pointer(gpointer data);
void sig_handler_reload(int sig);
gint set_and_get_timeout(gint c);
gboolean on_totem_win(GtkWidget *widget,GdkEvent  *event,gpointer data);
gchar *lrc_get_lyric_file(int flag);
void lyric_filename_set_to(gchar *name,LRC_FILE_FLAG flag);
void lrc_config_save_load(gboolean flag);
GtkWidget *lrc_about_dialog(gchar *ui);
gchar* lrc_get_value(gchar *name);
gchar *lrc_plugin_get_lrcname(void);
gboolean lrc_get_totem_flag(void);
void lrc_set_lyric_dir(char *dir);
char *lrc_get_lyric_dir(void);
gchar *lrc_get_lrc_fullpath(void);
GtkWindow *lrc_show_lrc_in_win(GtkWidget *wd);
gboolean append_new_string_to_conffile(char *key,char *string);
#endif ///LRC_SHOW_H
